import time
import tarfile


def tar_py(file_path):
    with tarfile.open(file_path) as t:
        return t.getnames()
    
if __name__ == "__main__":

    file_path = "/home/apple/tmp/bigfile.tar.gz"  
    # file_path = "/home/apple/tmp/abctrest.tar.gz"  

    start_time = time.perf_counter()
    filenames = tar_py(file_path)

    end_time = time.perf_counter()
    method1_time = end_time - start_time

    for filename in filenames:
        print(filename)
        
    print(f"Method tar_py took {method1_time:.6f} seconds")
